Sorry about the double post. I went back to make some corrections and add more information, but my editing window apparently closed while I was doing so.
There was an Awake! article several years back that discussed this very thing. It gave the example of how a non-custodial father who was prohibited by the Court from discussing religion with his child could comply with that restriction and still get the child thinking about spiritual things indirectly.
I couldn't find this specific article in the Society's online library, but under "Child Custody" in the index it refers to a couple of places (pages 4-9 and 13-14) in the October 22, 1988 Awake! that dealt extensively with divorce and this issue specifically. I'm not sure this is the exact article I am thinking of and I can't check it because the online library doesn't contain much material earlier than 2000. The index shows the reference, but it's grayed out and there is no link. Hopefully, someone here has a hard copy of that issue and will post a copy or a link to it. I'd appreciate it. You're welcome to PM me if you'd rather not post the whole article publicly.
The index had another reference that may be what I'm looking for. It was the December 8, 1997 Awake!, pages 5-7. It's not available online either.